﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Ex03.VehicalsObjectModel
{
    internal class ElectricEnergySystem : VehicalEnergySystem
    {
        // Ctor
        public ElectricEnergySystem(int i_ElecticityAmount) : base((float)i_ElecticityAmount)
        {
        }

        // Methods

        /// <summary>
        /// Charges the energy system with a given duration
        /// </summary>
        /// <param name="i_AddedDuration">The duration in minutes</param>
        /// <exception cref="ValueOutOfRangeException">When the amount is negative or exceeds the capacity of the system</exception>
        public void Charge(int i_AddedDuration)
        {
            AddEnergy((float)i_AddedDuration);
        }

        // Properties

        /// <summary>
        /// Gets the current minutes of available electricity in the system
        /// </summary>
        public int CurrentElectricityDuration
        {
            get
            {
                return (int)m_CurrentAmount;
            }
        }

        /// <summary>
        /// Gets the maximum minutes of electricity the system can hold
        /// </summary>
        public int MaxElectricityDuration
        {
            get
            {
                return (int)m_MaxAmount;
            }
        }
    }
}
